3.175 \(\int \frac {(d+e x^2) (a+b \log (c x^n))}{x^3} \, dx\)

Optimal. Leaf size=52 \[ -\frac {d \left (a+b \log \left (c x^n\right )\right )}{2 x^2}+\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}-\frac {b d n}{4 x^2} \]

[Out]

-1/4*b*d*n/x^2-1/2*d*(a+b*ln(c*x^n))/x^2+1/2*e*(a+b*ln(c*x^n))^2/b/n

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 47, normalized size of antiderivative = 0.90, number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {14, 2334, 2301} \[ -\frac {1}{2} \left (\frac {d}{x^2}-2 e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-\frac {b d n}{4 x^2}-\frac {1}{2} b e n \log ^2(x) \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x^2)*(a + b*Log[c*x^n]))/x^3,x]

[Out]

-(b*d*n)/(4*x^2) - (b*e*n*Log[x]^2)/2 - ((d/x^2 - 2*e*Log[x])*(a + b*Log[c*x^n]))/2

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rubi steps

\begin {align*} \int \frac {\left (d+e x^2\right ) \left (a+b \log \left (c x^n\right )\right )}{x^3} \, dx &=-\frac {1}{2} \left (\frac {d}{x^2}-2 e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (-\frac {d}{2 x^3}+\frac {e \log (x)}{x}\right ) \, dx\\ &=-\frac {b d n}{4 x^2}-\frac {1}{2} \left (\frac {d}{x^2}-2 e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b e n) \int \frac {\log (x)}{x} \, dx\\ &=-\frac {b d n}{4 x^2}-\frac {1}{2} b e n \log ^2(x)-\frac {1}{2} \left (\frac {d}{x^2}-2 e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 57, normalized size = 1.10 \[ -\frac {a d}{2 x^2}+a e \log (x)-\frac {b d \log \left (c x^n\right )}{2 x^2}+\frac {b e \log ^2\left (c x^n\right )}{2 n}-\frac {b d n}{4 x^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x^2)*(a + b*Log[c*x^n]))/x^3,x]

[Out]

-1/2*(a*d)/x^2 - (b*d*n)/(4*x^2) + a*e*Log[x] - (b*d*Log[c*x^n])/(2*x^2) + (b*e*Log[c*x^n]^2)/(2*n)

________________________________________________________________________________________

fricas [A]  time = 0.49, size = 59, normalized size = 1.13 \[ \frac {2 \, b e n x^{2} \log \relax (x)^{2} - b d n - 2 \, b d \log \relax (c) - 2 \, a d + 2 \, {\left (2 \, b e x^{2} \log \relax (c) + 2 \, a e x^{2} - b d n\right )} \log \relax (x)}{4 \, x^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x^2+d)*(a+b*log(c*x^n))/x^3,x, algorithm="fricas")

[Out]

1/4*(2*b*e*n*x^2*log(x)^2 - b*d*n - 2*b*d*log(c) - 2*a*d + 2*(2*b*e*x^2*log(c) + 2*a*e*x^2 - b*d*n)*log(x))/x^
2

________________________________________________________________________________________

giac [A]  time = 0.31, size = 63, normalized size = 1.21 \[ \frac {2 \, b n x^{2} e \log \relax (x)^{2} + 4 \, b x^{2} e \log \relax (c) \log \relax (x) + 4 \, a x^{2} e \log \relax (x) - 2 \, b d n \log \relax (x) - b d n - 2 \, b d \log \relax (c) - 2 \, a d}{4 \, x^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x^2+d)*(a+b*log(c*x^n))/x^3,x, algorithm="giac")

[Out]

1/4*(2*b*n*x^2*e*log(x)^2 + 4*b*x^2*e*log(c)*log(x) + 4*a*x^2*e*log(x) - 2*b*d*n*log(x) - b*d*n - 2*b*d*log(c)
 - 2*a*d)/x^2

________________________________________________________________________________________

maple [C]  time = 0.23, size = 266, normalized size = 5.12 \[ -\frac {\left (-2 e \,x^{2} \ln \relax (x )+d \right ) b \ln \left (x^{n}\right )}{2 x^{2}}-\frac {2 i \pi b e \,x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) \ln \relax (x )-2 i \pi b e \,x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (x )-2 i \pi b e \,x^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (x )+2 i \pi b e \,x^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3} \ln \relax (x )+2 b e n \,x^{2} \ln \relax (x )^{2}-4 b e \,x^{2} \ln \relax (c ) \ln \relax (x )-4 a e \,x^{2} \ln \relax (x )-i \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+i \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+i \pi b d \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}-i \pi b d \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+b d n +2 b d \ln \relax (c )+2 a d}{4 x^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x^2+d)*(b*ln(c*x^n)+a)/x^3,x)

[Out]

-1/2*b*(-2*e*ln(x)*x^2+d)/x^2*ln(x^n)-1/4*(-2*I*ln(x)*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x^2+2*I*ln(x)*Pi*b*e*
csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^2+2*I*ln(x)*Pi*b*e*csgn(I*c*x^n)^3*x^2-2*I*ln(x)*Pi*b*e*csgn(I*c*x^n)^2*
csgn(I*c)*x^2+I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-I*Pi*b*d*csgn(
I*c*x^n)^3+I*Pi*b*d*csgn(I*c*x^n)^2*csgn(I*c)+2*b*e*n*ln(x)^2*x^2-4*ln(x)*ln(c)*b*e*x^2-4*ln(x)*a*e*x^2+2*b*d*
ln(c)+b*d*n+2*a*d)/x^2

________________________________________________________________________________________

maxima [A]  time = 0.55, size = 49, normalized size = 0.94 \[ \frac {b e \log \left (c x^{n}\right )^{2}}{2 \, n} + a e \log \relax (x) - \frac {b d n}{4 \, x^{2}} - \frac {b d \log \left (c x^{n}\right )}{2 \, x^{2}} - \frac {a d}{2 \, x^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x^2+d)*(a+b*log(c*x^n))/x^3,x, algorithm="maxima")

[Out]

1/2*b*e*log(c*x^n)^2/n + a*e*log(x) - 1/4*b*d*n/x^2 - 1/2*b*d*log(c*x^n)/x^2 - 1/2*a*d/x^2

________________________________________________________________________________________

mupad [B]  time = 3.40, size = 66, normalized size = 1.27 \[ \ln \relax (x)\,\left (a\,e+\frac {b\,e\,n}{2}\right )-\frac {\frac {a\,d}{2}+\frac {b\,d\,n}{4}}{x^2}-\frac {\ln \left (c\,x^n\right )\,\left (\frac {b\,e\,x^2}{2}+\frac {b\,d}{2}\right )}{x^2}+\frac {b\,e\,{\ln \left (c\,x^n\right )}^2}{2\,n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((d + e*x^2)*(a + b*log(c*x^n)))/x^3,x)

[Out]

log(x)*(a*e + (b*e*n)/2) - ((a*d)/2 + (b*d*n)/4)/x^2 - (log(c*x^n)*((b*d)/2 + (b*e*x^2)/2))/x^2 + (b*e*log(c*x
^n)^2)/(2*n)

________________________________________________________________________________________

sympy [A]  time = 4.57, size = 63, normalized size = 1.21 \[ - \frac {a d}{2 x^{2}} + a e \log {\relax (x )} + b d \left (- \frac {n}{4 x^{2}} - \frac {\log {\left (c x^{n} \right )}}{2 x^{2}}\right ) - b e \left (\begin {cases} - \log {\relax (c )} \log {\relax (x )} & \text {for}\: n = 0 \\- \frac {\log {\left (c x^{n} \right )}^{2}}{2 n} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x**2+d)*(a+b*ln(c*x**n))/x**3,x)

[Out]

-a*d/(2*x**2) + a*e*log(x) + b*d*(-n/(4*x**2) - log(c*x**n)/(2*x**2)) - b*e*Piecewise((-log(c)*log(x), Eq(n, 0
)), (-log(c*x**n)**2/(2*n), True))

________________________________________________________________________________________